home *** CD-ROM | disk | FTP | other *** search
/ ftp.mactech.com 2010 / ftp.mactech.com.tar / ftp.mactech.com / thinkref / archive / THINKPascalUH2.1.sea / THINKPas Univ Hdr 2.1 / Interfaces / Balloons.p < prev    next >
Text File  |  1995-09-12  |  9KB  |  240 lines

  1. { Converted with MPW2TPas Tuesday, September 12, 1995 5:20:09 PM }
  2. {
  3.      File:        Balloons.p
  4.  
  5.      Contains:    Balloon Help Package Interfaces.
  6.  
  7.      Version:    Technology:    System 7.5
  8.                  Package:    Universal Interfaces 2.1 in “MPW Latest” on ETO #18
  9.  
  10.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  11.                  All rights reserved.
  12.  
  13.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  14.                  stack.  Include the file and version information (from above)
  15.                  in the problem description and send to:
  16.                      Internet:    apple.bugs@applelink.apple.com
  17.                      AppleLink:    APPLE.BUGS
  18.  
  19. }
  20.  
  21.  UNIT Balloons;
  22.  INTERFACE
  23.  
  24.  
  25. {$IFC UNDEFINED __BALLOONS__}
  26. {$SETC __BALLOONS__ := 1}
  27.  
  28.   USES
  29.    ConditionalMacros, Types, Quickdraw, Menus, TextEdit, Errors;
  30.  
  31. { $PUSH}
  32. { $ALIGN MAC68K}
  33. { $LibExport+}
  34.  
  35. CONST
  36.     hmBalloonHelpVersion        = $0002;                        { The real version of the Help Manager }
  37.     kHMHelpMenuID                = -16490;                        { Resource ID and menu ID of help menu }
  38.     kHMAboutHelpItem            = 1;                            { help menu item number of About Balloon Help… }
  39.     kHMShowBalloonsItem            = 3;                            { help menu item number of Show/Hide Balloons }
  40.     kHMHelpID                    = -5696;                        { ID of various Help Mgr package resources (in Pack14 range) }
  41.     kBalloonWDEFID                = 126;                            { Resource ID of the WDEF proc used in standard balloons }
  42. { Dialog item template type constant }
  43.     helpItem                    = 1;                            { key value in DITL template that corresponds to the help item }
  44. { Options for Help Manager resources in 'hmnu', 'hdlg', 'hrct', 'hovr', & 'hfdr' resources }
  45.     hmDefaultOptions            = 0;                            { default options for help manager resources }
  46.     hmUseSubID                    = 1;                            { treat resID's in resources as subID's of driver base ID (for Desk Accessories) }
  47.     hmAbsoluteCoords            = 2;                            { ignore window port origin and treat rectangles as absolute coords (local to window) }
  48.  
  49.     hmSaveBitsNoWindow            = 4;                            { don't create a window, just blast bits on screen. No update event is generated }
  50.     hmSaveBitsWindow            = 8;                            { create a window, but restore bits behind window when window goes away & generate update event }
  51.     hmMatchInTitle                = 16;                            { for hwin resources, match string anywhere in window title string }
  52. { Constants for Help Types in 'hmnu', 'hdlg', 'hrct', 'hovr', & 'hfdr' resources }
  53.     kHMStringItem                = 1;                            { pstring used in resource }
  54.     kHMPictItem                    = 2;                            { 'PICT' ResID used in resource }
  55.     kHMStringResItem            = 3;                            { 'STR#' ResID & index used in resource }
  56.     kHMTEResItem                = 6;                            { Styled Text Edit ResID used in resource ('TEXT' & 'styl') }
  57.     kHMSTRResItem                = 7;                            { 'STR ' ResID used in resource }
  58.     kHMSkipItem                    = 256;                            { don't display a balloon }
  59.     kHMCompareItem                = 512;                            { Compare pstring in menu item w/ PString in resource item ('hmnu' only) }
  60.     kHMNamedResourceItem        = 1024;                            { Use pstring in menu item to get 'STR#', 'PICT', or 'STR ' resource ('hmnu' only) }
  61.     kHMTrackCntlItem            = 2048;                            { Reserved }
  62. { Constants for hmmHelpType's when filling out HMMessageRecord }
  63.     khmmString                    = 1;                            { help message contains a PString }
  64.     khmmPict                    = 2;                            { help message contains a resource ID to a 'PICT' resource }
  65.     khmmStringRes                = 3;                            { help message contains a res ID & index to a 'STR#' resource }
  66.     khmmTEHandle                = 4;                            { help message contains a Text Edit handle }
  67.     khmmPictHandle                = 5;                            { help message contains a Picture handle }
  68.     khmmTERes                    = 6;                            { help message contains a res ID to 'TEXT' & 'styl' resources }
  69.     khmmSTRRes                    = 7;                            { help message contains a res ID to a 'STR ' resource }
  70.     kHMEnabledItem                = 0;                            { item is enabled, but not checked or control value = 0 }
  71.  
  72. { ResTypes for Styled TE Handles in Resources }
  73.     kHMTETextResType            = 'TEXT';                        { Resource Type of text data for styled TE record w/o style info }
  74.     kHMTEStyleResType            = 'styl';
  75.  
  76.     kHMDisabledItem                = 1;                            { item is disabled, grayed in menus or disabled in dialogs }
  77.     kHMCheckedItem                = 2;                            { item is enabled, and checked or control value = 1 }
  78.     kHMOtherItem                = 3;                            { item is enabled, and control value > 1 }
  79. { Method parameters to pass to HMShowBalloon }
  80.     kHMRegularWindow            = 0;                            { Create a regular window floating above all windows }
  81.     kHMSaveBitsNoWindow            = 1;                            { Just save the bits and draw (for MDEF calls) }
  82.     kHMSaveBitsWindow            = 2;                            { Regular window, save bits behind, AND generate update event }
  83.  
  84. { Resource Types for whichType parameter used when extracting 'hmnu' & 'hdlg' messages }
  85.     kHMMenuResType                = 'hmnu';                        { ResType of help resource for supporting menus }
  86.     kHMDialogResType            = 'hdlg';                        { ResType of help resource for supporting dialogs }
  87.     kHMWindListResType            = 'hwin';                        { ResType of help resource for supporting windows }
  88.     kHMRectListResType            = 'hrct';                        { ResType of help resource for rectangles in windows }
  89.     kHMOverrideResType            = 'hovr';                        { ResType of help resource for overriding system balloons }
  90.     kHMFinderApplResType        = 'hfdr';
  91.  
  92.  
  93. TYPE
  94.     HMStringResType = RECORD
  95.         hmmResID:                INTEGER;
  96.         hmmIndex:                INTEGER;
  97.     END;
  98.  
  99.     HMMessageRecord = RECORD
  100.         hmmHelpType:            SInt16;
  101.         CASE INTEGER OF
  102.         0: (
  103.             hmmString:                    Str255;
  104.            );
  105.         1: (
  106.             hmmPict:                    SInt16;
  107.            );
  108.         2: (
  109.             hmmTEHandle:                TEHandle;
  110.            );
  111.         3: (
  112.             hmmStringRes:                HMStringResType;
  113.            );
  114.         4: (
  115.             hmmPictRes:                    SInt16;
  116.            );
  117.         5: (
  118.             hmmPictHandle:                PicHandle;
  119.            );
  120.         6: (
  121.             hmmTERes:                    SInt16;
  122.            );
  123.         7: (
  124.             hmmSTRRes:                    SInt16;
  125.            );
  126.     END;
  127.  
  128.     HMMessageRecPtr = ^HMMessageRecord;
  129.  
  130.     TipFunctionProcPtr = ProcPtr;  { FUNCTION TipFunction(tip: Point; structure: RgnHandle; VAR r: Rect; VAR balloonVariant: INTEGER): OSErr; }
  131.     TipFunctionUPP = UniversalProcPtr;
  132.  
  133. CONST
  134.     uppTipFunctionProcInfo = $00003FE0; { FUNCTION (4 byte param, 4 byte param, 4 byte param, 4 byte param): 2 byte result; }
  135.  
  136. FUNCTION NewTipFunctionProc(userRoutine: TipFunctionProcPtr): TipFunctionUPP;
  137.     {$IFC NOT GENERATINGCFM }
  138.     INLINE $2E9F;
  139.     {$ENDC}
  140.  
  141. FUNCTION CallTipFunctionProc(tip: Point; structure: RgnHandle; VAR r: Rect; VAR balloonVariant: INTEGER; userRoutine: TipFunctionUPP): OSErr;
  142.     {$IFC NOT GENERATINGCFM}
  143.     INLINE $205F, $4E90;
  144.     {$ENDC}
  145. {  Public Interfaces  }
  146.  
  147. FUNCTION HMGetHelpMenuHandle(VAR mh: MenuRef): OSErr;
  148.     {$IFC NOT GENERATINGCFM}
  149.     INLINE $303C, $0200, $A830;
  150.     {$ENDC}
  151. FUNCTION HMShowBalloon({CONST}VAR aHelpMsg: HMMessageRecord; tip: Point; alternateRect: RectPtr; tipProc: TipFunctionUPP; theProc: SInt16; balloonVariant: SInt16; method: SInt16): OSErr;
  152.     {$IFC NOT GENERATINGCFM}
  153.     INLINE $303C, $0B01, $A830;
  154.     {$ENDC}
  155. FUNCTION HMRemoveBalloon: OSErr;
  156.     {$IFC NOT GENERATINGCFM}
  157.     INLINE $303C, $0002, $A830;
  158.     {$ENDC}
  159. FUNCTION HMGetBalloons: BOOLEAN;
  160.     {$IFC NOT GENERATINGCFM}
  161.     INLINE $303C, $0003, $A830;
  162.     {$ENDC}
  163. FUNCTION HMSetBalloons(flag: BOOLEAN): OSErr;
  164.     {$IFC NOT GENERATINGCFM}
  165.     INLINE $303C, $0104, $A830;
  166.     {$ENDC}
  167. FUNCTION HMShowMenuBalloon(itemNum: SInt16; itemMenuID: SInt16; itemFlags: SInt32; itemReserved: SInt32; tip: Point; alternateRect: RectPtr; tipProc: TipFunctionUPP; theProc: SInt16; balloonVariant: SInt16): OSErr;
  168.     {$IFC NOT GENERATINGCFM}
  169.     INLINE $303C, $0E05, $A830;
  170.     {$ENDC}
  171. FUNCTION HMGetIndHelpMsg(whichType: ResType; whichResID: SInt16; whichMsg: SInt16; whichState: SInt16; VAR options: UInt32; VAR tip: Point; VAR altRect: Rect; VAR theProc: SInt16; VAR balloonVariant: SInt16; VAR aHelpMsg: HMMessageRecord; VAR count: SInt16): OSErr;
  172.     {$IFC NOT GENERATINGCFM}
  173.     INLINE $303C, $1306, $A830;
  174.     {$ENDC}
  175. FUNCTION HMIsBalloon: BOOLEAN;
  176.     {$IFC NOT GENERATINGCFM}
  177.     INLINE $303C, $0007, $A830;
  178.     {$ENDC}
  179. FUNCTION HMSetFont(font: SInt16): OSErr;
  180.     {$IFC NOT GENERATINGCFM}
  181.     INLINE $303C, $0108, $A830;
  182.     {$ENDC}
  183. FUNCTION HMSetFontSize(fontSize: UInt16): OSErr;
  184.     {$IFC NOT GENERATINGCFM}
  185.     INLINE $303C, $0109, $A830;
  186.     {$ENDC}
  187. FUNCTION HMGetFont(VAR font: SInt16): OSErr;
  188.     {$IFC NOT GENERATINGCFM}
  189.     INLINE $303C, $020A, $A830;
  190.     {$ENDC}
  191. FUNCTION HMGetFontSize(VAR fontSize: UInt16): OSErr;
  192.     {$IFC NOT GENERATINGCFM}
  193.     INLINE $303C, $020B, $A830;
  194.     {$ENDC}
  195. FUNCTION HMSetDialogResID(resID: SInt16): OSErr;
  196.     {$IFC NOT GENERATINGCFM}
  197.     INLINE $303C, $010C, $A830;
  198.     {$ENDC}
  199. FUNCTION HMSetMenuResID(menuID: SInt16; resID: SInt16): OSErr;
  200.     {$IFC NOT GENERATINGCFM}
  201.     INLINE $303C, $020D, $A830;
  202.     {$ENDC}
  203. FUNCTION HMBalloonRect({CONST}VAR aHelpMsg: HMMessageRecord; VAR coolRect: Rect): OSErr;
  204.     {$IFC NOT GENERATINGCFM}
  205.     INLINE $303C, $040E, $A830;
  206.     {$ENDC}
  207. FUNCTION HMBalloonPict({CONST}VAR aHelpMsg: HMMessageRecord; VAR coolPict: PicHandle): OSErr;
  208.     {$IFC NOT GENERATINGCFM}
  209.     INLINE $303C, $040F, $A830;
  210.     {$ENDC}
  211. FUNCTION HMScanTemplateItems(whichID: SInt16; whichResFile: SInt16; whichType: ResType): OSErr;
  212.     {$IFC NOT GENERATINGCFM}
  213.     INLINE $303C, $0410, $A830;
  214.     {$ENDC}
  215. FUNCTION HMExtractHelpMsg(whichType: ResType; whichResID: SInt16; whichMsg: SInt16; whichState: SInt16; VAR aHelpMsg: HMMessageRecord): OSErr;
  216.     {$IFC NOT GENERATINGCFM}
  217.     INLINE $303C, $0711, $A830;
  218.     {$ENDC}
  219. FUNCTION HMGetDialogResID(VAR resID: SInt16): OSErr;
  220.     {$IFC NOT GENERATINGCFM}
  221.     INLINE $303C, $0213, $A830;
  222.     {$ENDC}
  223. FUNCTION HMGetMenuResID(menuID: SInt16; VAR resID: SInt16): OSErr;
  224.     {$IFC NOT GENERATINGCFM}
  225.     INLINE $303C, $0314, $A830;
  226.     {$ENDC}
  227. FUNCTION HMGetBalloonWindow(VAR window: WindowRef): OSErr;
  228.     {$IFC NOT GENERATINGCFM}
  229.     INLINE $303C, $0215, $A830;
  230.     {$ENDC}
  231.  
  232. { $ALIGN RESET}
  233. { $POP}
  234.  
  235. {$ENDC} {__BALLOONS__}
  236.  
  237.  IMPLEMENTATION
  238.  END.
  239.  
  240.